#ifndef KRIGING_H
#define KRIGING_H

#include <qwt_plot.h>
#include "syntheticsemivariogram.h"
#include "matrix.h"
#include "points.h"


class Kriging
{
public:
    Kriging(SyntheticSemivariogram* semivariogram);
    //static QVector< QVector<double> > interpolate();
    void calculateCovariances (QVector< QVector<double> > mappedDistances);
    void calculateColumnMatrixOfCovariances(Points points, Points estimatedVariable);
    QVector< QVector<double> > getMatrixOfCovariances();
    QVector< QVector<double> > getColumnMatrixOfCovariances();
    void setInverseMatrixOfCovariances(QVector< QVector<double> > inverseMatrix);
    QVector< QVector<double> > getInverseMatrixOfCovariances();
    void setMatrixOfWeights(QVector< QVector<double> > matrixOfWeights);
    QVector< QVector<double> > getMatrixOfWeights();
    double estimateValue(Points points);

private:
    SyntheticSemivariogram* semivariogram;
    QVector< QVector<double> > columnMatrixOfCovariances;
    QVector< QVector<double> > matrixOfCovariances;
    QVector< QVector<double> > matrixOfWeights;
    QVector< QVector<double> > inverseMatrixOfCovariances;
    double a(double distance);
    void fillMatrixOfConvariance();
    void fillColumnMatrixOfCovariances();


};

#endif // KRIGING_H


